/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package com.plian.system.mapper.pm.annualdonationrecordmain;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.plian.system.entity.pm.annualdonationrecordmain.AnnualDonationRecordMain;
import com.plian.system.vo.pm.annualdonationrecordmain.AnnualDonationRecordStatisticalDetailVO;
import com.plian.system.vo.pm.annualdonationrecordmain.AnnualDonationRecordStatisticalVO;
import com.plian.system.vo.pm.annualdonationrecordmain.AnnualDonationYearStatisticalDetailVO;
import com.plian.system.vo.pm.annualdonationrecordmain.AnnualDonationYearStatisticalVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 企业年度捐赠计划备案 Mapper 接口
 *
 * @author gangan
 * @since 2019-10-24
 */
public interface AnnualDonationRecordMainMapper extends BaseMapper<AnnualDonationRecordMain> {

	/**
	 * 执行选备案参照页
	 *
	 * @param page
	 * @param queryWrapper
	 * @return
	 */
	List<AnnualDonationRecordMain> preList(@Param("page") IPage<AnnualDonationRecordMain> page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper);

	/**
	 * 以备案号排序的年度捐赠计划备案统计报表
	 * @param orgIds
	 * @param year
	 * @return
	 */
	List<AnnualDonationRecordStatisticalVO> annualDonationRecordStatistical(@Param("orgIds") List<String> orgIds, @Param("year") String year);

	/**
	 * 以备案号排序的年度捐赠计划备案统计 明细
	 * @param id
	 * @return
	 */
	List<AnnualDonationRecordStatisticalDetailVO> annualDonationRecordStatisticalDetail(@Param("id") Long id);


	/**
	 * 以集团为单位的年度捐赠计划统计报表
	 * @param orgIds
	 * @param year
	 * @param lastYear
	 * @return
	 */
	List<AnnualDonationYearStatisticalVO> annualDonationYearStatistical(@Param("orgIds") List<String> orgIds,
																		@Param("year") String year,
																		@Param("lastYear") String lastYear);


	/**
	 * 以集团为单位的年度捐赠计划执行统计报表
	 * @param orgIds
	 * @param year
	 * @return
	 */
	List<AnnualDonationYearStatisticalVO> annualDonationExecuteYearStatistical(@Param("orgIds") List<String> orgIds, @Param("year") String year);

	/**
	 * 以集团为单位的年度捐赠计划统计 明细
	 * @param year
	 * @param reportCompanyId
	 * @return
	 */
	List<AnnualDonationYearStatisticalDetailVO> annualDonationYearStatisticalDetail(@Param("year") String year, @Param("reportCompanyId") String reportCompanyId);

	/**
	 * 以集团为单位的年度捐赠计划执行统计 明细
	 * @param year
	 * @param reportCompanyId
	 * @return
	 */
	List<AnnualDonationYearStatisticalDetailVO> annualDonationExecuteYearStatisticalDetail(@Param("year") String year, @Param("reportCompanyId") String reportCompanyId);
}
